package com.pengliu.config;

import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class SysEnv implements EnvironmentAware{
	/**
	 * 项目环境
	 */
	public static String active;
	/**
	 * 启动端口
	 */
	public static String port;
	/**
	 * 项目上下文路径
	 */
	public static String contextPath;

	public void setEnvironment(Environment environment) {
		active = environment.getProperty("spring.profiles.active");
		port = environment.getProperty("server.port");
		contextPath = environment.getProperty("server.context-path");
	}
}
